Integrand size = 27, antiderivative size = 198 \[ \int \frac {\cot ^4(c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {2 b \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a^5 d}-\frac {\left (3 a^4-12 a^2 b^2+8 b^4\right ) \text {arctanh}(\cos (c+d x))}{8 a^5 d}-\frac {b \left (4 a^2-3 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {\left (5 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^3 d}+\frac {b \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 a d} \]
[Out]
Time = 0.51 (sec) , antiderivative size = 198, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.259, Rules used = {2972, 3134, 3080, 3855, 2739, 632, 210} \[ \int \frac {\cot ^4(c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=\frac {b \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}-\frac {2 b \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{a^5 d}-\frac {b \left (4 a^2-3 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {\left (5 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^3 d}-\frac {\left (3 a^4-12 a^2 b^2+8 b^4\right ) \text {arctanh}(\cos (c+d x))}{8 a^5 d}-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 a d} \]
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2972
Rule 3080
Rule 3134
Rule 3855
Rubi steps \begin{align*} \text {integral}& = \frac {b \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 a d}-\frac {\int \frac {\csc ^3(c+d x) \left (3 \left (5 a^2-4 b^2\right )-a b \sin (c+d x)-4 \left (3 a^2-2 b^2\right ) \sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx}{12 a^2} \\ & = \frac {\left (5 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^3 d}+\frac {b \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 a d}-\frac {\int \frac {\csc ^2(c+d x) \left (-8 b \left (4 a^2-3 b^2\right )-a \left (9 a^2-4 b^2\right ) \sin (c+d x)+3 b \left (5 a^2-4 b^2\right ) \sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx}{24 a^3} \\ & = -\frac {b \left (4 a^2-3 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {\left (5 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^3 d}+\frac {b \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 a d}-\frac {\int \frac {\csc (c+d x) \left (-3 \left (3 a^4-12 a^2 b^2+8 b^4\right )+3 a b \left (5 a^2-4 b^2\right ) \sin (c+d x)\right )}{a+b \sin (c+d x)} \, dx}{24 a^4} \\ & = -\frac {b \left (4 a^2-3 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {\left (5 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^3 d}+\frac {b \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 a d}-\frac {\left (b \left (a^2-b^2\right )^2\right ) \int \frac {1}{a+b \sin (c+d x)} \, dx}{a^5}+\frac {\left (3 a^4-12 a^2 b^2+8 b^4\right ) \int \csc (c+d x) \, dx}{8 a^5} \\ & = -\frac {\left (3 a^4-12 a^2 b^2+8 b^4\right ) \text {arctanh}(\cos (c+d x))}{8 a^5 d}-\frac {b \left (4 a^2-3 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {\left (5 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^3 d}+\frac {b \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 a d}-\frac {\left (2 b \left (a^2-b^2\right )^2\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^5 d} \\ & = -\frac {\left (3 a^4-12 a^2 b^2+8 b^4\right ) \text {arctanh}(\cos (c+d x))}{8 a^5 d}-\frac {b \left (4 a^2-3 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {\left (5 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^3 d}+\frac {b \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 a d}+\frac {\left (4 b \left (a^2-b^2\right )^2\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^5 d} \\ & = -\frac {2 b \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a^5 d}-\frac {\left (3 a^4-12 a^2 b^2+8 b^4\right ) \text {arctanh}(\cos (c+d x))}{8 a^5 d}-\frac {b \left (4 a^2-3 b^2\right ) \cot (c+d x)}{3 a^4 d}+\frac {\left (5 a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^3 d}+\frac {b \cot (c+d x) \csc ^2(c+d x)}{3 a^2 d}-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 a d} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(433\) vs. \(2(198)=396\).
Time = 6.76 (sec) , antiderivative size = 433, normalized size of antiderivative = 2.19 \[ \int \frac {\cot ^4(c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {2 b \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {\sec \left (\frac {1}{2} (c+d x)\right ) \left (b \cos \left (\frac {1}{2} (c+d x)\right )+a \sin \left (\frac {1}{2} (c+d x)\right )\right )}{\sqrt {a^2-b^2}}\right )}{a^5 d}+\frac {\left (-4 a^2 b \cos \left (\frac {1}{2} (c+d x)\right )+3 b^3 \cos \left (\frac {1}{2} (c+d x)\right )\right ) \csc \left (\frac {1}{2} (c+d x)\right )}{6 a^4 d}+\frac {\left (5 a^2-4 b^2\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )}{32 a^3 d}+\frac {b \cot \left (\frac {1}{2} (c+d x)\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )}{24 a^2 d}-\frac {\csc ^4\left (\frac {1}{2} (c+d x)\right )}{64 a d}+\frac {\left (-3 a^4+12 a^2 b^2-8 b^4\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{8 a^5 d}+\frac {\left (3 a^4-12 a^2 b^2+8 b^4\right ) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{8 a^5 d}+\frac {\left (-5 a^2+4 b^2\right ) \sec ^2\left (\frac {1}{2} (c+d x)\right )}{32 a^3 d}+\frac {\sec ^4\left (\frac {1}{2} (c+d x)\right )}{64 a d}+\frac {\sec \left (\frac {1}{2} (c+d x)\right ) \left (4 a^2 b \sin \left (\frac {1}{2} (c+d x)\right )-3 b^3 \sin \left (\frac {1}{2} (c+d x)\right )\right )}{6 a^4 d}-\frac {b \sec ^2\left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )}{24 a^2 d} \]
[In]
[Out]
Time = 0.52 (sec) , antiderivative size = 291, normalized size of antiderivative = 1.47
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{3}}{4}-\frac {2 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2} b}{3}-2 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{3}+2 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a \,b^{2}+10 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a^{2} b -8 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b^{3}}{16 a^{4}}-\frac {2 b \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{a^{5} \sqrt {a^{2}-b^{2}}}-\frac {1}{64 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}-\frac {-4 a^{2}+4 b^{2}}{32 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {\left (6 a^{4}-24 a^{2} b^{2}+16 b^{4}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16 a^{5}}+\frac {b}{24 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}-\frac {b \left (5 a^{2}-4 b^{2}\right )}{8 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{d}\) | \(291\) |
default | \(\frac {\frac {\frac {\left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{3}}{4}-\frac {2 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2} b}{3}-2 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{3}+2 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a \,b^{2}+10 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) a^{2} b -8 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) b^{3}}{16 a^{4}}-\frac {2 b \left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{a^{5} \sqrt {a^{2}-b^{2}}}-\frac {1}{64 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}-\frac {-4 a^{2}+4 b^{2}}{32 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {\left (6 a^{4}-24 a^{2} b^{2}+16 b^{4}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16 a^{5}}+\frac {b}{24 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}-\frac {b \left (5 a^{2}-4 b^{2}\right )}{8 a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{d}\) | \(291\) |
risch | \(\frac {i \left (12 i a \,b^{2} {\mathrm e}^{5 i \left (d x +c \right )}-12 i a \,b^{2} {\mathrm e}^{7 i \left (d x +c \right )}+9 i a^{3} {\mathrm e}^{3 i \left (d x +c \right )}+12 i a \,b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-48 a^{2} b \,{\mathrm e}^{6 i \left (d x +c \right )}+24 b^{3} {\mathrm e}^{6 i \left (d x +c \right )}+15 i a^{3} {\mathrm e}^{i \left (d x +c \right )}+9 i a^{3} {\mathrm e}^{5 i \left (d x +c \right )}+96 a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}-72 b^{3} {\mathrm e}^{4 i \left (d x +c \right )}-12 i a \,b^{2} {\mathrm e}^{i \left (d x +c \right )}+15 i a^{3} {\mathrm e}^{7 i \left (d x +c \right )}-80 a^{2} b \,{\mathrm e}^{2 i \left (d x +c \right )}+72 b^{3} {\mathrm e}^{2 i \left (d x +c \right )}+32 a^{2} b -24 b^{3}\right )}{12 d \,a^{4} \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{4}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{8 d a}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b^{2}}{2 a^{3} d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b^{4}}{a^{5} d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{8 d a}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b^{2}}{2 a^{3} d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b^{4}}{a^{5} d}+\frac {i \sqrt {a^{2}-b^{2}}\, b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \left (\sqrt {a^{2}-b^{2}}-a \right )}{b}\right )}{d \,a^{3}}-\frac {i \sqrt {a^{2}-b^{2}}\, b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \left (\sqrt {a^{2}-b^{2}}-a \right )}{b}\right )}{d \,a^{5}}-\frac {i \sqrt {a^{2}-b^{2}}\, b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \left (\sqrt {a^{2}-b^{2}}+a \right )}{b}\right )}{d \,a^{3}}+\frac {i \sqrt {a^{2}-b^{2}}\, b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \left (\sqrt {a^{2}-b^{2}}+a \right )}{b}\right )}{d \,a^{5}}\) | \(590\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 410 vs. \(2 (183) = 366\).
Time = 0.59 (sec) , antiderivative size = 904, normalized size of antiderivative = 4.57 \[ \int \frac {\cot ^4(c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=\text {Too large to display} \]
[In]
[Out]
Timed out. \[ \int \frac {\cot ^4(c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {\cot ^4(c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 375 vs. \(2 (183) = 366\).
Time = 0.48 (sec) , antiderivative size = 375, normalized size of antiderivative = 1.89 \[ \int \frac {\cot ^4(c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\frac {3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 8 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 120 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 96 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{4}} + \frac {24 \, {\left (3 \, a^{4} - 12 \, a^{2} b^{2} + 8 \, b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{5}} - \frac {384 \, {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} a^{5}} - \frac {150 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 600 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 400 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 120 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 96 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 8 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a^{4}}{a^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \]
[In]
[Out]
Time = 12.16 (sec) , antiderivative size = 953, normalized size of antiderivative = 4.81 \[ \int \frac {\cot ^4(c+d x) \csc (c+d x)}{a+b \sin (c+d x)} \, dx=\text {Too large to display} \]
[In]
[Out]